{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
 
<script type="text/javascript">
<!--
{literal}
function content_preview(post_id) {
	var preview_data = {
		'option': 'com_agora',
		'task': 'moderation',
		'action': 'get_content',
		'id': post_id,
		'format': 'raw'
	};
	new Ajax('index.php', {
			method: 'post',
			postBody: Object.toQueryString(preview_data),
			onFailure: function(){},
			onComplete: function(inResponse) {
				var box = SqueezeBox.initialize();
				box.assignOptions();
				box.setContent('string',inResponse);
			}
	}).request();
}
{/literal}
//-->
</script>
 
{*<div class="ag_innerwrap">
	<p>$paging_links</p>
</div>*}
<div class="ag_postlinksTop">
	<div class="ag_inbox">
		<div class="ag_pagelink">
			{include file=agora:include/paginate.tpl}
			<div class="ag_forumTools">
				<ul id="ag_f_menu">
					<li class="ag_node">
						<a href="javascript:void(0);" class="ag_f_menu_title">##MODERATION_TOOLS##</a>
						<ul>
							<li class="ag_li">
								<a href="{url task=moderation action=approve_all_topics}" class="icon_subscribe">##MODERATION_APPROVE_ALL##</a>
							</li>
							<li class="ag_li">
								<a href="{url task=moderation action=decline_all_topics}" onclick="return confirm('##MODERATION_DECLINEALL_TOPIC_CONFIRM##')" class="icon_subscribe">##MODERATION_DECLINE_ALL##</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
	</div>
</div>

<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##MODERATION_TOPICS##</span></h2>
</div>

{foreach from=$result item=post key=post_count}
{cycle values='roweven,rowodd' assign=vtbg}

<div class="ag_outerwrap ag_blockpost{$vtbg}">
	<!-- post header -->
	<div class="ag_rightend">
		<div class="ag_headerbar">
			<span class="ag_middle">
				<span class="ag_postnum">
					##Forum##: <a href="{url task=forum id=$post.forum_id}">{$post.forum_name}</a>
				</span>
				<span class="ag_postdate">
					<a name="t{$post_count}"></a>
					<a href="{url task=moderation action=show_posts p=$page}#t{$post_count}">{$post.posted|agora_date}</a> ##MODERATION_BY## 
					<a href="{url task=profile user_id=$post.poster_id}">{$post.poster|nomail|escape} {$post.poster_ip}</a>
				</span>
			</span>
		</div>
	</div>
	<!-- /post header -->
	<!-- post content -->
	<div>
		<div class="ag_postrow {if $agora_config.o_userdata eq 0}ag_left_column{elseif $agora_config.o_userdata eq 1}ag_right_column{/if}">
			<div class="ag_postrow_container">
				<div class="ag_postrow_wrap">
					<div class="ag_postrow_col1">
						<!-- post text -->
						<h3 class="ag_posttitle">{$post.subject}<br/><i>{$post.descrip_t}</i></h3>
						<div class="ag_postmsg">{$post.message|truncate:100}
						<br /><a href="#" onclick="content_preview({$post.id});return false;">##MODERATION_VIEW_FULL##</a>
						</div>
						<!-- /post text -->
					</div>
				</div>
				<div class="ag_postrow_col2">
					<!-- info  -->
					<div class="ag_avatararea userimg">
						<dl>
							<dt>
								<a href="{url task=profile user_id=$post.poster_id}"><img src="{$post.avatar.avatar}"></a>
							</dt>
							{if $post.can_approve}
							<dd>
								<span class="ag_bttn ag_bttn_r">
									<a href="{url task=moderation action=approve_topic id=$post.topic_id post_id=$post.id pg=$page nm=$post_count }" title="##MODERATION_APPROVE##">##MODERATION_APPROVE##</a>
								</span>
								<span class="ag_bttn ag_bttn_r">
									<a href="{url task=moderation action=decline_topic id=$post.topic_id pg=$page nm=$post_count }" onclick="return confirm('##MODERATION_DECLINE_TOPIC_CONFIRM##')" title="##MODERATION_DECLINE##">##MODERATION_DECLINE##</a>
								</span>
							</dd>
							{/if}
						</dl>
					</div>
					<!-- /info  -->
				</div>
			</div>
		</div>
	</div>
	<!-- /post content -->
</div>
<div class="ag_post_separator"></div>
{foreachelse}
<div class="ag_tablewrap">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td class="ag_spacer ag_userlist_empty" colspan="5">##No hits##</td>
			</tr>
		</tbody>
	</table>
</div>
{/foreach}

<div class="ag_postlinksBottom">
	<div class="ag_inbox">
		<div class="ag_pagelink">
			{include file=agora:include/paginate.tpl}
		</div>
	</div>
</div>
<div class="ag_clearer"></div>